﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AirManager.Entities;
using AirManager.Repository;

namespace AirManager
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //var repository = new RepositoryBase();

            var milita = new MilitaryFleet();
            var fleetRepository = new FleetRepository();

            //var pilotrepository = new PilotRepository();
            //var teste4 = new Fleet { Nome = "Aviao Ajustes Executados Teste teste", Id = 30};
            //var teste1 = new Fleet { Nome = "Grand Caravan 222", Id = 1 };
            //var teste2 = new Fleet { Nome = "Grand Caravan SkyLine" };
            //var teste3 = new Fleet { Nome = "Grand Caravan new generate test" };

            milita.Nome = "F22 raptor";
            milita.NumeroFoguetes = 22;
            fleetRepository.Save(milita);
            
            //var armazenadosnobancofleet = fleetRepository.FindAll<Fleet>();
            //var aviaonovopilot = fleetRepository.BuscarNome("Grand Caravan new generate");
            //var pilot2 = new Pilot { Nome = "Renata"};
            //var pilot1 = pilotrepository.Get<Pilot>(29);
            //aviaonovopilot.AddPilot(pilot2);
            //aviaonovopilot.AddPilot(pilot1);
            //fleetRepository.Save(aviaonovopilot);
            
            
            //var ajuste1 = new Fix { Descricao = "Revisão Inicial", DataRevisao = DateTime.Now};
            //var ajuste2 = new Fix { Descricao = "Revisão Pré Voo", DataRevisao = DateTime.Now};
            //var pilot1 = new Pilot {Nome = "Eduardo Souza"};
            //pilot1.Fleets.Add(teste4);
            //teste4.AddFix(ajuste2);
            //teste4.AddFix(ajuste1);
            //teste4.Pilots.Add(pilot1);
            //var buscaaviao = fleetRepository.BuscarNome("Grand Caravan new generate");        
            //fleetRepository.Save(teste4);
            //buscaaviao.AddFix(ajuste2);
            //fleetRepository.Save(buscaaviao);
            //pilotrepository.Save(pilot1);

        }


    }
}
